package com.efast.dmom.mgmt.service.les.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.efast.dmom.mgmt.bean.les.ImmediateReplenishmentByLibraryBean;
import com.efast.dmom.mgmt.bean.les.ImmediateReplenishmentByRequestBean;
import com.efast.dmom.mgmt.dao.les.TwInvPalMriDao;
import com.efast.dmom.mgmt.entity.les.TwInvPalMri;
import com.efast.dmom.mgmt.entity.master.TmBasDpath;
import com.efast.dmom.mgmt.service.les.TwInvPalMriService;
import com.efast.dmom.mgmt.utils.Assist;


@Service("twInvPalMriServiceImpl")
public class TwInvPalMriServiceImpl implements TwInvPalMriService {

	@Autowired
	private TwInvPalMriDao twInvPalMriDao;

	// 【即时补货---按出库】计算出一个job周期内实际消耗了多少零件数，并且按照补货路径归类 即时补货 : Immediate replenishment
	@Override
	public List<ImmediateReplenishmentByLibraryBean> queryTimelyReplenishmentByLibrary(int dpathId) {
		return twInvPalMriDao.queryTimelyReplenishmentByLibrary(dpathId);
	}

	// 【即时补货---按请求】计算出一个job周期内实际消耗了多少零件数，并且按照补货路径归类 即时补货 : Immediate replenishment
	@Override
	public List<ImmediateReplenishmentByRequestBean> queryTimelyReplenishmentByRequest(int dpathId) {
		return twInvPalMriDao.queryTimelyReplenishmentByRequest(dpathId);
	}

	// 【窗口补货-按累计消耗---按出库】：按照wms实际出库记录算消耗=======计算出一条补货路径的零件消耗量
	@Override
	public List<ImmediateReplenishmentByLibraryBean> queryOnePathPartsConsume(int dpathId) {
		return twInvPalMriDao.queryOnePathPartsConsume(dpathId);
	}

	// 【窗口补货-按累计消耗---按请求】：按照sps传给wms的kitting消耗算=======计算出一条补货路径的零件消耗量
	@Override
	public List<ImmediateReplenishmentByRequestBean> queryOnePathPartsConsumeByRequest(int tmBasDpathId) {
		return twInvPalMriDao.queryOnePathPartsConsumeByRequest(tmBasDpathId);
	}

	// 查询出所有的补货路径
	@Override
	public List<TmBasDpath> queryAllPath() {
		return twInvPalMriDao.queryAllPath();
	}
	

	@Override
	public long getTwInvPalMriRowCount(Assist assist) {
		return twInvPalMriDao.getTwInvPalMriRowCount(assist);
	}

	@Override
	public List<TwInvPalMri> selectTwInvPalMri(Assist assist) {
		return twInvPalMriDao.selectTwInvPalMri(assist);
	}

	@Override
	public TwInvPalMri selectTwInvPalMriByObj(TwInvPalMri obj) {
		return twInvPalMriDao.selectTwInvPalMriByObj(obj);
	}

	@Override
	public TwInvPalMri selectTwInvPalMriById(Integer id) {
		return twInvPalMriDao.selectTwInvPalMriById(id);
	}

	@Override
	public int insertTwInvPalMri(TwInvPalMri value) {
		return twInvPalMriDao.insertTwInvPalMri(value);
	}

	@Override
	public int insertNonEmptyTwInvPalMri(TwInvPalMri value) {
		return twInvPalMriDao.insertNonEmptyTwInvPalMri(value);
	}

	@Override
	public int insertTwInvPalMriByBatch(List<TwInvPalMri> value) {
		return twInvPalMriDao.insertTwInvPalMriByBatch(value);
	}

	@Override
	public int deleteTwInvPalMriById(Integer id) {
		return twInvPalMriDao.deleteTwInvPalMriById(id);
	}

	@Override
	public int deleteTwInvPalMri(Assist assist) {
		return twInvPalMriDao.deleteTwInvPalMri(assist);
	}

	@Override
	public int updateTwInvPalMriById(TwInvPalMri enti) {
		return twInvPalMriDao.updateTwInvPalMriById(enti);
	}

	@Override
	public int updateTwInvPalMri(TwInvPalMri value, Assist assist) {
		return twInvPalMriDao.updateTwInvPalMri(value, assist);
	}

	@Override
	public int updateNonEmptyTwInvPalMriById(TwInvPalMri enti) {
		return twInvPalMriDao.updateNonEmptyTwInvPalMriById(enti);
	}

	@Override
	public int updateNonEmptyTwInvPalMri(TwInvPalMri value, Assist assist) {
		return twInvPalMriDao.updateNonEmptyTwInvPalMri(value, assist);
	}
}